/* ============================================================
   NEXUS INFRADEV COST ESTIMATOR - COMPLETE CSS
   ============================================================ */

:root {
    --primary-color: #d97706; /* Nexus Theme Orange/Gold */
    --primary-hover: #b45309;
    --secondary-color: #475569;
    --accent-color: #fef3c7; /* Light Gold background */
    --text-main: #1e293b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --border-color: #e2e8f0;
}

/* 1. Reset & Global Layout Fixes */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden; /* Prevents horizontal scrolling issue */
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 2. Container & Step Styling */
section.step {
    max-width: 850px;
    width: 95%;
    margin: 3rem auto;
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    display: none; /* Controlled by JS active class */
}

section.step.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

/* 3. Grid Options (Step 1) */
.grid-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin: 1.5rem 0;
}

.option-card {
    border: 2px solid var(--border-color);
    padding: 1.2rem;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
    font-weight: 500;
}

.option-card input { display: none; }

.option-card:hover {
    border-color: var(--primary-color);
    background-color: #fffaf0;
}

.option-card.selected {
    background: var(--accent-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.1);
}

/* 4. Inputs & Selection */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--secondary-color);
}

input[type="number"], 
select, 
.hero-right input {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

/* 5. Contact Form (Step 4) */
.hero-right .form {
    background: #fafafa;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.hero-right .form h3 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

.hero-right .form p {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.phone {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    margin-bottom: 1rem;
    padding-left: 10px;
}

.phone span { color: #666; font-weight: bold; }

.phone input {
    border: none !important;
    margin-bottom: 0 !important;
}

.form button[type="submit"] {
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

/* 6. Navigation Buttons */
footer.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

button.btn-next, button.btn-prev {
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

.btn-next {
    background: var(--primary-color);
    color: white;
}

.btn-next:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-prev {
    background: var(--secondary-color);
    color: white;
}

/* 7. Output Table (Step 5) */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

th, td {
    padding: 15px;
    border: 1px solid var(--border-color);
    text-align: left;
}

th {
    background: #f1f5f9;
    font-weight: 600;
}

.total-section {
    margin-top: 1.5rem;
    background: var(--accent-color);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: right;
}

.total-section h3 {
    color: var(--primary-color);
    font-size: 1.6rem;
}

/* 8. Alerts */
.alert-box {
    position: fixed;
    top: 25px;
    right: 25px;
    min-width: 300px;
    padding: 20px;
    border-radius: 10px;
    color: white;
    z-index: 10000;
    display: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.alert-box.show { display: block; animation: slideIn 0.4s ease-out; }
.alert-box.success { background: #10b981; }
.alert-box.error { background: #ef4444; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 9. Mobile Responsiveness */
@media (max-width: 600px) {
    section.step {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }
    
    .grid-options {
        grid-template-columns: 1fr 1fr;
    }

    footer.btn-group {
        flex-direction: column-reverse;
        gap: 12px;
    }

    button.btn-next, button.btn-prev {
        width: 100%;
    }
}